//
//  StudioApplyViewController.m
//  Arts1
//
//  Created by 孤星晨宇 on 15/10/7.
//  Copyright © 2015年 Arts1. All rights reserved.
//

#import "StudioApplyViewController.h"
#import "StudioApplyBasicViewController.h"

#import "AllHeader.h"


@interface StudioApplyViewController ()


// 模糊视图
@property (nonatomic, strong) UIVisualEffectView *visualeffectview;

// 报名信息登记卡
@property (nonatomic, strong) StudioApplyBasicViewController *applyBVC;

// 返回按钮
@property (nonatomic, strong) UIButton *cancel;

@end

@implementation StudioApplyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor clearColor];
    // Do any additional setup after loading the view.
    
    [self createVisualEffectView];
    [self createApplyView];
    
}

// 毛玻璃效果
- (void)createVisualEffectView{
    UIVisualEffect *lightBlurEffect = [UIBlurEffect effectWithStyle:(UIBlurEffectStyleLight)];
    _visualeffectview = [[UIVisualEffectView alloc] initWithEffect:lightBlurEffect];
    _visualeffectview.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    _visualeffectview.alpha = 1.0;
    [self.view addSubview:_visualeffectview];
}


- (void)createApplyView{
    /**
    报名卡
     */
    _applyBVC = [[StudioApplyBasicViewController alloc] init];
    _applyBVC.ID = _ID;
    [self.view addSubview:_applyBVC.view];
    _applyBVC.view.frame = CGRectMake(40, 160, SCREEN_WIDTH - 80, 273);
    _applyBVC.view.layer.cornerRadius = 10;
    [UIView viewWideForShadowColor:_applyBVC.view];
    
    /**
     * 返回上一层界面
     */
    _cancel = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _cancel.frame = CGRectMake((SCREEN_WIDTH - 40) / 2.0, _applyBVC.view.bottom + 60, 40, 40);
    _cancel.layer.cornerRadius = 20;
    _cancel.layer.masksToBounds = YES;
    _cancel.alpha = 0.3;
    [_cancel setImage:[UIImage imageNamed:@"cancelcon"] forState:(UIControlStateNormal)];
    [_cancel addTarget:self action:@selector(clickBack:) forControlEvents:(UIControlEventTouchUpInside)];
//    [self.view addSubview:_cancel];
}

/**
 * 返回上一层界面
 */
- (void)clickBack:(UIButton *)btn{
    [self.navigationController popViewControllerAnimated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
